/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_delete_adv_objects.cpp

	$Header: /heroes4/script_delete_adv_objects.cpp $

	$NoKeywords: $

 ************************************************************************/

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "script_delete_adv_objects.h"

#include "adventure_map.h"
#include "streambuf_operators.h"

// --------------------------------------------------------------------------
// t_script_delete_adv_objects members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
bool t_script_delete_adv_objects::read_from_map(
	std::streambuf &	stream,
	int					format_version )
{
	return read_string16( stream, m_marker_name );
}

bool t_script_delete_adv_objects::read( std::streambuf& stream, int version )
{
	return read_string16( stream, m_marker_name );
}

bool t_script_delete_adv_objects::write( std::streambuf& stream ) const
{
	if (!t_abstract_script_action::write( stream ))
		return false;
	
	write_string16( stream, m_marker_name );

	return true;
}

void t_script_delete_adv_objects::execute(t_script_context_hero const& context) const
{
	assert(context.map);
	context.map->remove_by_deletion_marker( get_marker_name() );
}

void t_script_delete_adv_objects::execute(t_script_context_town const& context) const
{
	assert(context.map);
	context.map->remove_by_deletion_marker( get_marker_name() );
}

void t_script_delete_adv_objects::execute(t_script_context_object const& context) const
{
	assert(context.map);
	context.map->remove_by_deletion_marker( get_marker_name() );
}

void t_script_delete_adv_objects::execute(t_script_context_army const& context) const
{
	assert(context.map);
	context.map->remove_by_deletion_marker( get_marker_name() );
}

void t_script_delete_adv_objects::execute(t_script_context_global const& context) const
{
	assert(context.map);
	context.map->remove_by_deletion_marker( get_marker_name() );
}
